<?php
class Adzones extends UaModel {
	var $name = "Adzone";
	//var $name = "JobCategory";
	
	function getAllCategories($cid) {
		global $g_db;
		$sql = "select id from eos_jobcategory where id=" . $cid . " OR parentid=" . $cid;
		
		return $g_db->GetAll ( $sql );
	}
	
	/*
  function getAllJobCategories($conditions = null, $limit = null, $offset = null) {
		$sql = "SELECT Industry.id AS ID,name AS Name,parentid AS ParentID,product_amount AS ProductAmount,ia AS IndustryIa,ib AS IndustryIb,sell_amount AS SellAmount,buy_amount AS BuyAmount,company_amount AS CompanyAmount,product_amount,sell_amount,buy_amount,company_amount ";
		$sql.= "FROM ".$this->getTable(true)." ";
		//$sql .= "FROM eos_job_categories "
    $sql.= "WHERE 1 ";
		$sql.= $conditions;
		$sql.= " ORDER BY Industry.id ";
		if(!is_null($limit) && !is_null($offset)) $sql.= " LIMIT $limit,$offset";
		$tmp_arr = $GLOBALS['g_db']->GetAll($sql);
		return $tmp_arr;
	}
  */
	
	/*
  function formatSubIndusty($industries, $li = null) {
		global $media_paths;
		if(is_null($li)) $li = $GLOBALS['li'];
		global $nav;
		$return  = null;
		
		if (empty($industries)) {
			$return="<div id='divNextTwenty' align='center' class='time'>目前没有任何子分类。</div>";
		}elseif (is_array($industries)) {
	
			$i = 0;
			foreach ($industries as $inds) {
				$return.="<tr >
									<td height=25 align=left class=\"corhui\"><img src=\"".$media_paths['media_path']."images/icon_4.gif\" width=\"3\" height=\"5\">
									  &nbsp;<a
							href=\"".URL.strtolower($nav[$li]['ename'])."/list.php?sid=".$inds['ID']."\" class=\"link_black12\">".$inds['Name']."</A><span
							class=time>(".number_format($inds[strtolower($nav[$li]['ename'])."_amount"]).")</span> </TD>
							</TR>";
				if($i==10) $return.="</tbody>
							  </table></td>
							<td valign=top width=\"49%\"> <table cellspacing=3 cellpadding=1 width=\"100%\" border=0>
								<tbody>";
				$i++;
				if($i==21) {
					$return.= "<tr >
									<td height=25 align=center class=\"corhui\"><span
							class=time><a href=\"#\" onclick=\"xajax.call('nextIndustry',[2]);\">下20个行业</span></a></td>
							</tr>";
					break;
				}
			}
		}else {
			$return = "<font color=red>数据格式错误</font>";
		}
		
		return $return;
	}
  */
	
	function Adzones() {
	
	}

}
?>
